import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:toastification/toastification.dart';
import 'config/app_config.dart';
import 'pages/api_demo_page.dart';

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return ProviderScope(
      child: ToastificationWrapper(
        child: MaterialApp(
          title: AppConfig.appName,
          debugShowCheckedModeBanner: AppConfig.debugMode,
          theme: ThemeData(
            colorScheme: ColorScheme.fromSeed(
              seedColor: AppConfig.isProduction 
                ? Colors.blue 
                : AppConfig.isTesting 
                  ? Colors.orange 
                  : Colors.deepPurple,
            ),
            useMaterial3: true,
          ),
          home: const ApiDemoPage(), // 使用API演示页面
        ),
      ),
    );
  }
}
